package com.example.distillapplication.data.dao;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;

import com.example.distillapplication.data.entity.OperationLog;

import java.util.List;

@Dao
public interface OperationLogDao {

    @Insert
    public void insertOperationLog(OperationLog... operationLogs);

    @Query("SELECT * FROM OperationLog ORDER BY operationId DESC")
    public LiveData<List<OperationLog>> getAllOperationLog();

    @Query("SELECT * FROM OperationLog WHERE operationId = :operationId")
    public List<OperationLog> findOperationLogById(int operationId);

    @Delete
    void deleteOperationLog(OperationLog... operationLogs);
}
